<template>
	<view class="content">
		<view class="list">
			<view :class="[item.status == 2 ?'lists':'']" class="list_item p-r" v-for="item in sign_list">
				<view class=" d-f j-b">
					<view class="c1a f16 f-w d-f">
						{{item.title}} <text class="f12 cfd labels">{{item.jsfs}}</text>
					</view>
					<view class="f16 cfd f-w">
						{{item.xzfw}}
					</view>
				</view>
				<view v-if="item.gzfl" class="c76 f12 label_list">
					<label v-for="items in item.gzfl" class="lable">{{items}}</label>
				</view>
				<view class="c76 f12 d-f j-b publisher">
					<view class=" d-f">
						<image class="filter" src="/static/filter.png" alt="" />
						<text>{{item.ygdw}}</text>
					</view>
					<view class="">
						{{item.area_name}}
					</view>
				</view>
				<view class="d-f j-b but f-w">
					<view class="c1a f14">
						招聘人数：{{item.gwrs}}人
					</view>
					<view @click="face(item.sign_id)" class="cff f14 t-c" v-if="item.status == 1">
						立即签约
					</view>
					<view @click="agreement(item.sign_ur)" class="cff f14 t-c" v-if="item.status == 3">
						查看协议
					</view>
				</view>
				<image v-if="item.status == 0" class="p-a" src="/static/dsh.png" alt="" />
				<image v-if="item.status == 1" class="p-a" src="/static/ly.png" alt="" />
				<image v-if="item.status == 2" class="p-a" src="/static/wly.png" alt="" />
			</view>
			<view class="t-c null" v-if="sign_list.length <= 0">
				<image src="/static/null.png" mode="widthFix"></image>
				暂无内容
			</view>
			<view class="text_content f16 cc9" v-if="text">我也是有底线的~</view>
		</view>
	</view>
</template>

<script>
	import unis from '@/utils/util.js'
	export default {
		data() {
			return {
				page:1,
				page_size:10,
				sign_list:[],
				lastPage:0,
				text:false,
				status:0
			}
		},
		onLoad(e) {
			if(e.status){
				this.status = e.status
			}
		},
		onShow() {
			this.lists()
		},
		methods: {
			agreement(e){
				uni.navigateTo({
					url:'/pages/webview/webview?url=' + e
				})
			},
			face(e){
				uni.showLoading({
				    title: '加载中'
				});
				unis.getData('/api/sign_up/face/'+e, 'get', {
					
				}, function (res) {
					uni.hideLoading();
					if(res.code == 200){
						uni.navigateTo({
							url:'/pages/webview/webview?url=' + res.data.startFaceShortUrl
						})
					}
				});
			},
			lists(){
				var that = this
				unis.getData('/api/sign_up/list', 'get', {
					status:this.status,
					page:that.page,
					page_size:that.page_size,
				}, function (res) {
					if(res.code == 200){
						that.last_page = Math.ceil(res.data.total / that.page_size)
						if (that.page == 1) {
							that.sign_list = res.data.list,
							that.text = false
						} else {
							that.sign_list = that.sign_list.concat(res.data.list),
							that.text = false
						}
					}
				});
			},
		},
		onReachBottom(){
			if (this.page >= this.last_page) {
				this.text = true
			  return false
			}
			this.page++
			this.lists()
		},
	}
</script>

<style lang="scss" scoped>
.list{
	padding-top: 10px;
}
.lists{
	opacity: 0.5;
	filter: grayscale(100%);
}
.list_item{
	margin: 10px 16px 15px 16px;
	box-shadow: 0px 1rpx 45rpx 0px rgba(185, 185, 185, 0.6);
	padding: 13px 17px;
	background: #FFFFFF;
	border-radius: 4px 4px 4px 4px;
	.labels{
		background: rgba(253,75,55,0.1);
		padding: 2px 5px;
		margin-left: 4px;
	}
	.label_list{
		margin-top: 9px;
		.lable{
			padding: 2px 4px;
			background: #F0F0F0;
			border-radius: 4px 4px 4px 4px;
			margin-right: 5px;
		}
	}
	.publisher{
		margin-top: 13px;
		.filter{
			width: 13px;
			height: 13px;
			margin-right: 3px;
		}
	}
	.but{
		border-top: 1px solid #D8D8D8;
		margin-top: 11px;
		padding-top: 9px;
		.cff{
			width: 69px;
			height: 24px;
			background: #2D73FF;
			border-radius: 4px 4px 4px 4px;
			line-height: 24px;
		}
	}
	.p-a{
		width: 80px;
		height: 80px;
		top:0;
		right: 0;
	}
}
</style>
